package com.dongjiantong.openplatform.core;/**
 * Created by cao on 2017/12/13.
 */

import org.springframework.web.bind.annotation.RequestMethod;

import java.beans.ConstructorProperties;

/**
 * @author cao
 * @create 2017-12-13 下午8:27
 **/
public class OPHook {
    private RequestMethod httpMethod;
    private String url;

    public RequestMethod getHttpMethod() {
        return this.httpMethod;
    }

    public String getUrl() {
        return this.url;
    }

    public void setHttpMethod(RequestMethod httpMethod) {
        this.httpMethod = httpMethod;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public boolean equals(Object o) {
        if(o == this) {
            return true;
        } else if(!(o instanceof OPHook)) {
            return false;
        } else {
            OPHook other = (OPHook)o;
            if(!other.canEqual(this)) {
                return false;
            } else {
                Object this$httpMethod = this.getHttpMethod();
                Object other$httpMethod = other.getHttpMethod();
                if(this$httpMethod == null) {
                    if(other$httpMethod != null) {
                        return false;
                    }
                } else if(!this$httpMethod.equals(other$httpMethod)) {
                    return false;
                }

                Object this$url = this.getUrl();
                Object other$url = other.getUrl();
                if(this$url == null) {
                    if(other$url != null) {
                        return false;
                    }
                } else if(!this$url.equals(other$url)) {
                    return false;
                }

                return true;
            }
        }
    }

    public boolean canEqual(Object other) {
        return other instanceof OPHook;
    }

    @Override
    public int hashCode() {
       // int PRIME = true;
        int result = 1;
        Object $httpMethod = this.getHttpMethod();
         result = result * 31 + ($httpMethod == null?0:$httpMethod.hashCode());
        Object $url = this.getUrl();
        result = result * 31 + ($url == null?0:$url.hashCode());
        return result;
    }

    @Override
    public String toString() {
        return "OPHook(httpMethod=" + this.getHttpMethod() + ", url=" + this.getUrl() + ")";
    }

    @ConstructorProperties({"httpMethod", "url"})
    public OPHook(RequestMethod httpMethod, String url) {
        this.httpMethod = httpMethod;
        this.url = url;
    }
}